><

Intersection and Timeout



The Idle action inserts a script that monitors the browser window for a user-specified condition and triggers other actions, depending on whether the condition is true or false. You can choose between three conditions: timeout, intersection, and key compare. These actions are best used in the head section of the page as the conditions are to be checked automatically.

The Timeout action is a timer and switch combination. It lets you specify a time span after which the browser should switch between two states. The condition it monitors is "false" while the timeout period still lasts and returns "true" when the timeout period has elapsed. Either state has its own action. You can use this action to implement a timed switch in the browser window--for example, to switch the content of a banner image.

The Intersection condition monitors the browser window for the physical intersection of two floating boxes. It is true when the floating boxes overlap in the browser window and false if they don't. You can use the result of this action to trigger two further actions.

This action supplements the Drag Floating Box action (see Drag Floating Box). An intersection occurs when the paths of two floating boxes cross. The Intersection action may be connected, for example, with a Set Back Color action (see Set Back Color), causing the browser to change the background color.

To set up an Intersection or Timeout action:

1 Insert a Head Action in the head section of the page (see Setting up onload event actions).

2 Choose the Idle option from the Specials submenu of the Action menu in the Action Inspector.

3 Select the Condition tab (see Condition) and choose the Timeout option from the Specials submenu of the Action menu.

4 To have the action stop the first time the Timeout condition is true, select Exit Idle If Condition Returns True. By activating this option, you instruct the browser to switch states once only.

5 Enter a time span in seconds in the Timeout (secs.) text box.

6 Click the True tab and select the action to be triggered when the Timeout limit has elapsed. In the following example, the Timeout action triggers a Set Image URL action (see Set Image URL), causing the browser to change the content of an image.

7 Click the False tab and choose the action to be executed while the Timeout period still lasts. In the example shown above, you would use a second Set Image URL action that supplies an alternative image.

8 Preview the action in a 4.0 browser.

To set up an Intersection action as a condition:

1 Click the Condition tab; then choose the Intersection option from the Specials submenu of the Actions menu.

2 If you want the action to terminate the first time the Timeout condition is true, enable the Exit Idle If Condition Returns True option. By activating this option, you instruct the script to monitor the browser window for a single event.

3 Select the floating boxes you want to monitor for the intersection from the two Floating Box pop-up menus.

4 Click the True tab and choose the action you want to have triggered when an intersection occurs.

5 Click the False tab and choose the action to be executed while the floating boxes don't overlap.

6 Preview the action in a 4.0 browser.


Using Actions > Using Adobe GoLive actions > Intersection and Timeout